package com.lj.back.manage.scaffold.common.enums;

import com.lj.back.manage.scaffold.common.util.ResponseConstant;

/**
 * 统一返回枚举类
 * @author lv
 * @version 1.0.0
 */

public enum ResponseEnum {

    /**
     * 成功
     */
    SUCCESS(ResponseConstant.CODE_SUCCESS,ResponseConstant.MESSAGE_SUCCESS,true),

    /**
     * 错误
     */
    ERROR(ResponseConstant.CODE_ERROR,ResponseConstant.MESSAGE_ERROR,false),

    /**
     * 参数错误异常
     */
    PARAM_ERROR(ResponseConstant.PARAM_ERROR_CODE,ResponseConstant.PARAM_ERROR_MESSAGE,false),

    /**
     * 数据库模块---记录已存在
     */
    DATABASE_EXIST_ERROR(ResponseConstant.DATABASE_ERROR_CODE_EXIST,ResponseConstant.DATABASE_ERROR_MESSAGE_EXIST,false),

    /**
     * 数据库模块---记录不存在
     */
    DATABASE_NOT_EXIST_ERROR(ResponseConstant.DATABASE_ERROR_CODE_NOT_EXIST,ResponseConstant.DATABASE_ERROR_MESSAGE_NOT_EXIST,false),

    /**
     * 权限模块---权限不足
     */
    AUTHORIZATION_INSUFFICIENT_ERROR(ResponseConstant.AUTHORIZATION_ERROR_CODE_INSUFFICIENT,ResponseConstant.AUTHORIZATION_ERROR_MESSAGE_INSUFFICIENT,false),

    /**
     * 路径模块---找不到路径
     */
    PATH_NOT_FOUND(ResponseConstant.PATH_ERROR_CODE_NO_HANDLER,ResponseConstant.PATH_ERROR_MESSAGE_NO_HANDLER,false);

    private int code;

    private String message;

    private boolean success;

    ResponseEnum(int code, String message, boolean success){
        this.code = code;
        this.message = message;
        this.success = success;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }
}
